/*
 * Copyright (C) 2017-2019 Dremio Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import '../../styles/constants/index.scss';

.input-root {
  padding-top: map-get($map: $gutter-sizes, $key: half);
  padding-bottom: map-get($map: $gutter-sizes, $key: half);
  position: relative;

  .input__container {
    border-radius: 4px;
    height: 32px;
    border: solid 1px $border-color;
    display: flex;
    align-items: center;

    &.--focused {
      border: 1px solid $regentBlue;
    }

    &:hover {
      border: 1px solid $regentBlue;
    }

    &.--disabled {
      border-color: $border-color;
      background-color: $disabled-color;
      color: $oslo-gray;

      input {
        background-color: $disabled-color;
      }
    }

    &.--error {
      border-color: $error-color;
    }

    .input__prefix {
      background-color: $border-color;
      border-top-left-radius: $input-border-radius;
      border-bottom-left-radius: $input-border-radius;
      padding: 0px map-get($map: $gutter-sizes, $key: double);
      height: 100%;
      display: grid;
      align-content: center;
    }
    
    input {
      height: 100%;
      border: none;
      border-radius: $input-border-radius;
      padding: 0px;
      padding-left: map-get($map: $gutter-sizes, $key: full);
      width: 100%;
      font-family: inherit;
      font-size: inherit;
      font-weight: inherit;
      color: inherit;

      &.--prefixed {
        border-top-left-radius: 0px;
        border-bottom-left-radius: 0px;
      }

      &:focus {
        outline: none;
        background-color: $aliceBlue;
      }
    }
  }

}